package com.yjd.bi.loss.dao.impl;

import org.springframework.stereotype.Component;
import com.yjd.comm.base.dao.impl.BaseDaoImpl;
import com.yjd.bi.loss.model.UserLossModel;
import com.yjd.bi.loss.dao.IUserLossDao;

import java.util.Map;

/**
 * <b>description</b>：流失用户数表数据访问层 <br>
 * <b>time</b>：2018-06-28 11:06:59 <br>
 * <b>author</b>： weili valie.lin@foxmail.com
 */
@Component("userLossDao")
public class UserLossDaoImpl extends BaseDaoImpl implements IUserLossDao {

	private static final String SQLMAPNAMESPACE = UserLossModel.class.getName();
	private static final String PKNAME = "id";

	@Override
	public String getPrimaryKeyName() {
		return PKNAME;
	}

	@Override
	public String getSqlmapNamespace() {
		return SQLMAPNAMESPACE;
	}

	@Override
	public Integer getUsersInvestingCount(Map<String, Object> paramMap) {
		Object myObject = this.getSqlMap(false).queryForObject(this.getStatement("usersInvesting"),paramMap);
		if (myObject != null) {
			return Integer.valueOf(myObject.toString());
		}
		return 0;
	}
}
